
//
//  hdcgTableViewCell.m
//  PASystem
//
//  Created by michael on 16/8/26.
//  Copyright © 2016年 czd. All rights reserved.
//

#import "hdcgTableViewCell.h"

@implementation hdcgTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
          self.selectionStyle = UITableViewCellSelectionStyleNone;
       self.selectionStyle = UITableViewCellSelectionStyleNone;
    
     _label1 = [[UILabel alloc]init];
    _label1.frame = CGRectZero;
    _label1.numberOfLines = 0;
      [_label1 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label1];
    
       _label2 = [[UILabel alloc]init];
    _label2.frame = CGRectZero;
    _label2.numberOfLines = 0;
    _label2.textAlignment = NSTextAlignmentRight;
      [_label2 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label2];
    
       _label3 = [[UILabel alloc]init];
    _label3.frame = CGRectZero;
      [_label3 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label3];
    
       _label4 = [[UILabel alloc]init];
    _label4.frame = CGRectZero;
    _label4.numberOfLines = 0;
    _label4.textAlignment = NSTextAlignmentRight;
      [_label4 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label4];
    
       _label5 = [[UILabel alloc]init];
    _label5.frame = CGRectZero;
      [_label5 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label5];
    
       _label6 = [[UILabel alloc]init];
    _label6.frame = CGRectZero;
      [_label6 setFont:[UIFont systemFontOfSize:12]];
      _label6.textAlignment = NSTextAlignmentRight;
       [self.contentView addSubview:_label6];
    
       _label7 = [[UILabel alloc]init];
    _label7.frame = CGRectZero;
      [_label7 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label7];
    
       _label8 = [[UILabel alloc]init];
    _label8.frame = CGRectZero;
    _label8.textAlignment = NSTextAlignmentRight;
      [_label8 setFont:[UIFont systemFontOfSize:12]];
       [self.contentView addSubview:_label8];
    
}

return self;

}
- (void)layoutSubviews{

[super layoutSubviews];

float itemwidth = self.contentView.width;
float itemheight = (self.contentView.height-12)/4;
_label1.frame =CGRectMake(0, 0, itemwidth*.4, itemheight);
_label2.frame =CGRectMake(_label1.right, 0, itemwidth*.6, itemheight);
_label3.frame =CGRectMake(0, itemheight, itemwidth*.4, itemheight);
_label4.frame =CGRectMake(_label3.right,itemheight, itemwidth*.6, itemheight);
_label5.frame =CGRectMake(0,itemheight*2 , itemwidth*.4, itemheight);
_label6.frame =CGRectMake(_label5.right,itemheight*2 , itemwidth*.6, itemheight);
_label7.frame =CGRectMake(0,itemheight*3 , itemwidth*.4, itemheight);
_label8.frame =CGRectMake(_label7.right,itemheight*3 , itemwidth*.6, itemheight);
    _label1.text = @" 企业名称 :";
_label3.text = @" 预计成交额 :";
_label5.text = @" 成果指标1 :";
_label7.text = @" 成果指标2 :";

//achievementindex1
_label2.text = _dict[@"NAME"];
_label6.text = [NSString stringWithFormat:@"%@",_dict[@"ACHIEVEMENTINDEX1"]];

_label8.text = [NSString stringWithFormat:@"%@",_dict[@"ACHIEVEMENTINDEX2"]];
_label4.text = [NSString stringWithFormat:@"%@",_dict[@"AMOUNT"]];




//NSString *string = _dict[@"AWARDINGTIME"];
//NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
//    fmt.dateFormat = @"MMM d, yyyy HH:mm:ss aa";
// fmt.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en-US"];
//     NSDate *date = [fmt dateFromString:string];
//     NSDateFormatter *fm = [[NSDateFormatter alloc] init];
//    fm.dateFormat = @"yyyy-MM-dd";
//     NSString *selfYear = [fm stringFromDate:date];





}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


@end
